package com.laborder.sysyy.dao;



import com.laborder.sysyy.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Function: 用户dao层接口
 * @author: 786107529@qq.com FJL
 * @date:2018/8/26 11:17
 */
@Repository
@Mapper
public interface UserDaoMapper {
    /**
     * @Function: 登录查询
     * @author: 786107529@qq.com FJL
     * @date:2018/8/26 11:17
     */
    User login(Map<String, Object> map);
    /**
     * @Function: 分页查询
     * @author: 786107529@qq.com FJL
     * @date:2018/8/26 11:12
     */
    List<User> findUserWithPage(Map<String, Object> map);

    /**
     * @Function: 用户总数查询
     * @author: 786107529@qq.com FJL
     * @date:2018/8/26 11:14
     */
    int getUserCount(Map<String, Object> map);
    /**
     * @Function: 添加用户信息
     * @author: 786107529@qq.com FJL
     * @date:2018/8/26 11:51
     */
    boolean saveUserInfo(User user);
    /**
     * @Function: 查询所有用户
     * @author: 786107529@qq.com FJL
     * @date:2018/8/26 12:32
     */
    List<User> findAll();
    /**
     * @Function: 根据ID查询
     * @author: 786107529@qq.com FJL
     * @date:2018/8/26 15:14
     */
    User getUserInfoById(int userId);
    /**
     * @Function: 更新操作
     * @author: 786107529@qq.com FJL
     * @date:2018/8/26 15:17
     */
    boolean updateUserInfo(User user);
    /**
     * @Function: 删除操作
     * @author: 786107529@qq.com FJL
     * @date:2018/8/26 15:38
     */
    int delUserInfo(int userId);
    /**
     * @Function: 修改密码
     * @author: 786107529@qq.com FJL
     * @date:2018/9/13 10:52
     */
    boolean editPassword(User user);
    /**
     * @Function: 解除权限
     * @author: 786107529@qq.com FJL
     * @date:2018/9/16 16:29
     */
    boolean delUserRole(User user);
    User findUserByName(String userName);
}
